<template>
  <div class="NavBar" :class="collapse ? 'is-collapse-main' : ''">
    <el-row :gutter="15">
      <el-col :xs="4" :sm="12" :md="12" :lg="12" :xl="12">
        <div class="left-panel">
          <i
            :class="collapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'"
            :title="collapse ? '展开' : '收起'"
            class="fold-unfold"
            @click="handleCollapse"
          ></i>
        </div>
      </el-col>
      <el-col :xs="20" :sm="12" :md="12" :lg="12" :xl="12">
        <div class="right-panel"></div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapActions, mapGetters } from "vuex";

export default {
  data() {
    return {};
  },

  computed: {
    ...mapGetters({
      collapse: "settings/collapse"
    })
  },
  methods: {
    ...mapActions({
      changeCollapse: "settings/changeCollapse"
    }),
    handleCollapse() {
      this.changeCollapse();
    }
  }
};
</script>

<style lang="scss" scoped>
.NavBar {
  position: fixed;
  top: 0;
  right: 0;
  background-color: #ffffff;
  z-index: $base-z-index - 3;
  height: $base-nav-bar-height;
  box-shadow: $base-box-shadow;
  width: calc(100% - #{$base-left-menu-width});
  transition: $base-transition;
  &.is-collapse-main {
    width: calc(100% - #{$base-left-menu-width-min});
  }
}
</style>
